package p1000;

import java.util.Scanner;

public class Main1999不可摸数 {

    public static void main(String[] args) {
        int[] sum = new int[1000001];
        boolean[] mo = new boolean[1001];

        for (int i = 1; i <= 1000000; i++)     //打表，标出可摸数
        {
            for (int j = i * 2; j <= 1000000; j += i) {
                sum[j] += i;
            }
        }

        for (int i = 1; i <= 1000000; i++) {
            if (sum[i] <= 1000)
                mo[sum[i]] = true;
        }

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        while (n-- > 0) {
            int a = scanner.nextInt();

            if (mo[a]) {
                System.out.println("no");
            } else {
                System.out.println("yes");
            }
        }
    }

}
